package main

import (
	"GORM_Demo04/part11/Router"
	_ "GORM_Demo04/part11/dbope" //启动的时候加载数据库连接
	"github.com/gin-gonic/gin"
	"net/http"
)

/*func Roule(context *gin.Context) {
	context.HTML(200, "demo01/index.html", nil)
}*/

func main() {
	//获取engine引擎
	r := gin.Default()

	//加载html界面
	r.LoadHTMLGlob("part11/templates/**/*")

	//加载静态文件
	r.StaticFS("/s", http.Dir("part11/static"))

	//获取index界面
	r.GET("/", func(context *gin.Context) {
		context.HTML(200, "demo01/index.html", nil)
	})

	//调用总路由
	Router.Adj_Router(r)

	//启动
	r.Run()
}
